Carbon


MPBlockCopy

Header: Multiprocessing.h Carbon status: Supported

Copies a block of memory.

void MPBlockCopy (
    LogicalAddress source, 
    LogicalAddress destination, 
    ByteCount size
);
source

The starting address of the memory block you want to copy.

destination

The location to which you want to copy the memory block.

size

The number of bytes to copy.

DISCUSSION

This function simply calls through to the Driver Services Library function BlockMoveData. Note that you should not make any assumptions about the state of the destination memory while this function is executing. In the intermediate state, values may be present that are neither the original nor the final ones. For example, this function may use the 'dcbz' instruction. If the underlying memory is not cacheable, if the memory is write-through instead of copy-back, or if the cache block is flushed for some reason, the 'dcbz' instruction will write zeros to the destination. You can avoid the use of the 'dcbz' instruction by calling BlockMoveDataUncached, but even that function makes no other guarantees about the memory block's intermediate state.

As with all shared memory, your application must synchronize access to the memory blocks to avoid data corruption. MPBlockCopy ensures the copying stays within the bounds of the area specified by size, but the calling task can be preempted during the copying process.

VERSION NOTES

Introduced with Multiprocessing Services 1.0.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)